/*
 * Main.c
 * 主程序
 *  Created on: 2016年8月27日
 *      Author: LongShu
 */
#include <stdlib.h>

#include "utils/memory.h"
#include "utils/utils.h"
#include "exAll.h"
#include "tree/tree.h"

void test(char * data) {
	print("%d", 123);
	char *p = MALLOC(5, char);
	p[0] = 1;
	p[1] = 2;
	p[2] = 3;
	printArray(p, 5);
	free(p);

	int arr[] = { 100, 2, 3, 4, 5 };
	int size = sizeofArray(arr);
	printArray(arr, size);

	SORT(arr, size, int);
	printArray(arr, size);

	REVERSE(arr, size, int);
	printArray(arr, size);
	println('%s',toString(cdcd));
	println(%d 这也行 %d, 4, 'x');
	println(%s, toString(12312));
}

/*
 * 神奇的字符串拷贝,达夫设备
 */
int duffs_device(char *from, char *to, int count) {
	int n = (count + 7) / 8;
	switch (count % 8) {
	case 0:
		do {
			*to++ = *from++;
			case 7:
			*to++ = *from++;
			case 6:
			*to++ = *from++;
			case 5:
			*to++ = *from++;
			case 4:
			*to++ = *from++;
			case 3:
			*to++ = *from++;
			case 2:
			*to++ = *from++;
			case 1:
			*to++ = *from++;
		} while (--n > 0);
	}
	return count;
}
void duffstest() {
	char from[10] = "1234567890";
	char to[10];
	duffs_device(from, to, 10);
	println(%s, to);
}

int main(int argc, char *argv[]) {
	//day01
//	ex01();
//	ex02_04();
//	ex05();
//	ex06();
//	ex07();
//	ex09();
//	ex10();
//	ex11();
//	ex13();
//	ex14();
//	day02

	tree2();
	println(\t------------------------------------);
	println(\t++++++++++++++++++++++++++++++++++++);
	tree3();

	print(按任意键退出...)
//	getchar();
	return EXIT_SUCCESS;
}

